package com.aizuda.boot.modules.business.contract_operation_log.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 合同操作日志记录表
 */
@Schema(description="合同操作日志记录表")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "contract_operation_log")
public class ContractOperationLog {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description="主键ID")
    private Long id;

    /**
     * 合同ID
     */
    @TableField(value = "contract_id")
    @Schema(description="合同ID")
    private Long contractId;

    /**
     * 流程类型编码，关联流程类型字典表
     */
    @TableField(value = "flow_type")
    @Schema(description="流程类型编码，关联流程类型字典表")
    private String flowType;

    /**
     * 操作类型编码，关联操作类型字典表
     */
    @TableField(value = "action_type")
    @Schema(description="操作类型编码，关联操作类型字典表")
    private String actionType;

    /**
     * 操作来源（用户/系统）
     */
    @TableField(value = "source_type")
    @Schema(description="操作来源（用户/系统）")
    private String sourceType;

    /**
     * 用户ID（系统操作可为空）
     */
    @TableField(value = "user_id")
    @Schema(description="用户ID（系统操作可为空）")
    private Long userId;

    /**
     * 用户名（系统操作可为空）
     */
    @TableField(value = "username")
    @Schema(description="用户名（系统操作可为空）")
    private String username;

    /**
     * 用户昵称（可为空）
     */
    @TableField(value = "nickname")
    @Schema(description="用户昵称（可为空）")
    private String nickname;

    /**
     * 流程节点ID（如审批节点ID，可为空）
     */
    @TableField(value = "node_id")
    @Schema(description="流程节点ID（如审批节点ID，可为空）")
    private Long nodeId;

    /**
     * 流程节点名称（如"法务审批"）
     */
    @TableField(value = "node_name")
    @Schema(description="流程节点名称（如法务审批）")
    private String nodeName;

    /**
     * 操作前合同状态编码
     */
    @TableField(value = "contract_status_before")
    @Schema(description="操作前合同状态编码")
    private Integer contractStatusBefore;

    /**
     * 操作后合同状态编码
     */
    @TableField(value = "contract_status_after")
    @Schema(description="操作后合同状态编码")
    private Integer contractStatusAfter;

    /**
     * 操作时间
     */
    @TableField(value = "action_time")
    @Schema(description="操作时间")
    private Date actionTime;

    /**
     * 扩展信息（JSON字符串，如合同文件信息等）
     */
    @TableField(value = "ext_data")
    @Schema(description="扩展信息（JSON字符串，如合同文件信息等）")
    private String extData;

    /**
     * 操作备注
     */
    @TableField(value = "remark")
    @Schema(description="操作备注")
    private String remark;

    public static final String COL_ID = "id";

    public static final String COL_CONTRACT_ID = "contract_id";

    public static final String COL_FLOW_TYPE = "flow_type";

    public static final String COL_ACTION_TYPE = "action_type";

    public static final String COL_SOURCE_TYPE = "source_type";

    public static final String COL_USER_ID = "user_id";

    public static final String COL_USERNAME = "username";

    public static final String COL_NICKNAME = "nickname";

    public static final String COL_NODE_ID = "node_id";

    public static final String COL_NODE_NAME = "node_name";

    public static final String COL_CONTRACT_STATUS_BEFORE = "contract_status_before";

    public static final String COL_CONTRACT_STATUS_AFTER = "contract_status_after";

    public static final String COL_ACTION_TIME = "action_time";

    public static final String COL_EXT_DATA = "ext_data";

    public static final String COL_REMARK = "remark";
}